<div class="content container">
    <div class="time pull-right">截止时间：{$tasktime}</div>

    <!-- container -->
    <form action="" enctype="multipart/form-data" method="post" id="form">
        <!-- <input type="hidden" name="eid" value="{$eid}"> -->
    <section class="exam-list">
        <if condition = "$single neq ''">
        <h2>单选题（{$exam_score['dx']}分/题）</h2>
        <!-- 题目列表 -->
        <div class="exam-list-li">
            <!-- 考试-头部 -->
            <div class="exam-list-li-head"></div>
            <!-- 考试-头部 End -->
            <!-- 考试-题目 -->
            <volist name="single" id="v">
            <div class="exam-list-li-text">{$v.content}</div>
            <!-- 考试-题目 End -->
            <!-- 考试-答案 -->
            <div class="exam-list-li-answer">
                    <volist name="v['select']" id="vo">
                            <div class="radio">
                                <label>
                                    <input type="radio" name="{$v.id}" value="{$key|delrn}">{$vo}
                                </label>
                            </div>
                        </volist>
            </div>
            <!-- 考试-答案 End -->
        </volist>
        </div>
        <else/>
        </if>
        <!-- 题目列表 End -->
        <if condition = "$multi neq ''">
        <h2>多选题（{$exam_score['dxz']}分/题）</h2>
        <!-- 题目列表 -->
        <div class="exam-list-li">
            <!-- 考试-头部 -->
            <div class="exam-list-li-head"></div>
            <!-- 考试-头部 End -->
            <!-- 考试-题目 -->
            <volist name="multi" id="v">
            <div class="exam-list-li-text">{$v.content}</div>
            <!-- 考试-题目 End -->
            <!-- 考试-答案 -->
            <div class="exam-list-li-answer">
                <volist name="v['select']" id="vo">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" name="{$v.id}[]" value="{$key|delrn}">{$vo}
                    </label>
                </div>
            </volist>
            </div>
           </volist>
            <!-- 考试-答案 End -->
        </div>
       <else/>
       </if>
       <!-- 题目列表 End -->
       <if condition = "$judge neq ''">
            <h2>判断题（{$exam_score['pd']}分/题）</h2>
            <!-- 题目列表 -->
            <div class="exam-list-li">
                <!-- 考试-头部 -->
                <div class="exam-list-li-head"></div>
                <!-- 考试-头部 End -->
                <!-- 考试-题目 -->
                <volist name="judge" id="v">
                <div class="exam-list-li-text">{$v.content}</div>
                <!-- 考试-题目 End -->
                <!-- 考试-答案 -->
                <div class="exam-list-li-answer">
                        <div class="radio">
                                <label>
                                        <input type="radio" name="{$v.id}" value="A">A.对
                                </label>
                            </div>
                            <div class="radio">
                                    <label>
                                        <input type="radio" name="{$v.id}" value="B">B.错
                                    </label>
                                </div>
                </div>
                <!-- 考试-答案 End -->
            </volist>
            </div>
            <else/>
            </if>
            <!-- 题目列表 End -->
       <if condition = "$fill neq ''">
        <h2>填空题（{$exam_score['tk']}分/题）</h2>
        <!-- 题目列表 -->
        <div class="exam-list-li">
            <!-- 考试-头部 -->
            <div class="exam-list-li-head"></div>
            <!-- 考试-头部 End -->
            <!-- 考试-题目 -->
            <volist name="fill" id="v">
            <div class="exam-list-li-text">{$v.content}</div>
            <!-- 考试-题目 End -->
            <!-- 考试-答案 -->
            <div class="exam-list-li-answer">
                    <textarea class="form-control" rows="3" placeholder="可以输入多行文本" name="{$v.id}"></textarea>
                </div><br>
                <!-- 考试-答案 End -->
            </volist>
            </div><br>
        <else/>
       </if>
        <!-- 题目列表 End -->
        <if condition = "$subjective neq ''">
                <div class="exam-list-li-head">
                        <div class="pull-right">
                            <div class="btn-file">
                                    <span style="color:#fff" id="sp">上传文件</span>
                                <!-- <input type="text" value="" id="filename"> -->
                                <input type="file" name="upfile" id="upfile"  onchange="handleFile()">
                            </div>
                        </div>
                    </div>
        <h2>主观题（{$exam_score['zg']}分/题）</h2>
        <!-- 题目列表 -->
        <div class="exam-list-li">
            <!-- 考试-头部 -->
            <!-- 考试-头部 End -->
            <volist name="subjective" id="v">
            <!-- 考试-题目 -->
            <div class="exam-list-li-text">{$v.content}</div>
            <!-- 考试-题目 End -->
            <!-- 考试-答案 -->
            <div class="exam-list-li-answer">
                <textarea class="form-control" rows="3" placeholder="可以输入多行文本" name="{$v.id}"></textarea>
            </div><br>
        </volist>
        
            <!-- 考试-答案 End -->
        </div>
        <else/>
       </if>
        <!-- 题目列表 End -->

        <!-- 提交按钮 -->
        <div class="exam-submit">
            <!-- <button class="btn btn-success" onclick="temporary()">暂存</button>　 -->
            <button class="btn btn-primary" onclick="finish()">交卷</button>
        </div>
    </section>
    </form>
    <!-- container End -->
</div>
</div>
<script src="__PUBLIC__/dist/js/jquery.js"></script>
<script>
        var file = document.getElementById("upfile");
        function handleFile(){
            if(file.value != ""){
               $("#sp").text('已选择文件');
            }
        }
   </script>
<script>
        // function temporary(){
        //     var action ="index.php?g=User&m=Student&a=temporary&eid={$eid}";
        //     document.all.form.action = action;
        //     document.all.form.submit();
        //     } 
        function finish(){
            var action ="index.php?g=User&m=Student&a=finish_homework&eid={$eid}";
            document.all.form.action = action;
            document.all.form.submit();
            }  
</script>